package com.hxh.area.service.impl;

import com.hxh.area.entity.Area;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author huangxunhui
 * Date: Created in 2021/8/15 13:37
 * Utils: IntelliJ IDEA
 */

@SpringBootTest
@RunWith(SpringRunner.class)
public class DemoTest {

    @Autowired
    private AreaServiceImpl areaService;

    @Test
    public void test() {
        areaService.list().forEach(i -> {
            if (i.getParent() != 0) {
                Area area = areaService.getById(i.getParent());
                if (area == null) {
                    System.out.println(i.getName());
                }
            }
        });
    }
}
